<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ include file="/include/taglibs.jsp" %>
<html>
<script type="text/javascript">
    var userInfo = '${user.userType}';
</script>
<head>
    <%@include file="/include/header.html" %>
    <script type="text/javascript" src="${ctx}/appjs/invoice/invoiceApply.js"></script>
    <link rel="stylesheet" href="${ctx}/statics/css/update.css">
    <link rel="stylesheet" href="${ctx}/statics/css/common.css">
    <link rel="stylesheet" href="${ctx}/libjs/plugins/bootstrap-table-pagejump/bootstrap-table-pagejump.css">
    <script src="${ctx}/libjs/plugins/bootstrap-table-pagejump/bootstrap-table-pagejump.js"></script>
    <%--<link rel="stylesheet" href="${ctx}/libjs/plugins/laydate/skins/laydate.css">--%>
    <link rel="stylesheet" href="${ctx}/libjs/plugins/laydate/laydate.css">
    <script src="${ctx}/libjs/plugins/laydate/laydate.js"></script>
    <link rel="stylesheet" href="${ctx}/libjs/plugins/bootStrap-table-fixed-column/bootstrap-table-fixed-columns.css">
    <script src="${ctx}/libjs/plugins/bootStrap-table-fixed-column/bootstrap-table-fixed-columns.js"></script>
</head>
<script type="text/javascript">
    $('#topLink', window.parent.document).html(function (i, origText) {
        return '<ol class="breadcrumb">' +
            '<li class="breadcrumb-item">' +
            '<a href="">主页</a>' +
            '</li>' +
            '<li class="breadcrumb-item">' +
            '<a>开票申请管理</a>' +
            '</li>' +
            '<li class="breadcrumb-item">' +
            '<strong>开票申请列表</strong>' +
            '</li>' +
            '<li class="breadcrumb-item">' +
            '<a href="javascript:window.history.back()"><i class="fa fa-times"></i> 返回</a>' +
            '</li>' +
            '</ol>';
    });

    var has_add = '';
    var has_edit = '';
    var has_delete = '';
    var OperationsManagement_invoiceApply_export = false;
    var OperationsManagement_invoiceApply_update = <%=session.getAttribute("user") %>;
</script>

<body class="gray-bg">
<div class="wrapper wrapper-content ">
    <div class="col-sm-12">
        <div class="ibox">
            <div class="ibox-body">
                <div class="row">
                    <input id="addressee" name="addressee" type="text" class="form-control shortInput input-distance"
                           placeholder="申请人">
                    <input id="orderNum" name="orderNum" type="text" class="form-control shortInput input-distance"
                           placeholder="订单编号">
                    <input id="beginTime" name="beginTime" type="text" class="form-control shortInput input-distance"
                           autocomplete="false"
                           placeholder="开始时间">
                    <input id="endTime" name="endTime" type="text" class="form-control input-distance"
                           autocomplete="false"
                           placeholder="结束时间">
                    <button class="btn btn-success input-distance" onclick="invoiceApply.reLoad()">查询</button>
                    <c:if test="${user.userType eq '0'}">
                        <div class="pull-left search col-md-1" style="flex: 0;">
                            <button class="btn btn-primary" onclick="invoiceApply.add()">新增</button>
                        </div>
                    </c:if>
<%--                    <shiro:hasPermission name="OperationsManagement_invoiceApply_export">--%>
<%--                    <div class="pull-left search fr exportNumInput">--%>
<%--                        <input id="count" name="count" type="text" class="form-control"--%>
<%--                               placeholder="导出条数">--%>
<%--                    </div>--%>
                    <div class="pull-left search fr">
                        <button class="btn btn-success input-distance exportBtn" onclick="invoiceApply.exportList()">导出</button>
                    </div>
<%--                    </shiro:hasPermission>--%>

                </div>
                <table id="exampleTable" data-mobile-responsive="true">
                </table>
            </div>
        </div>
    </div>
</div>

<%--<shiro:hasPermission name="OperationsManagement_invoiceApply_export">--%>
<%--    <script>--%>
<%--        OperationsManagement_invoiceApply_export = true;--%>
<%--    </script>--%>
<%--</shiro:hasPermission>--%>
<%--<shiro:hasPermission name="OperationsManagement_invoiceApply_update">--%>
<%--    <script>--%>
<%--        OperationsManagement_invoiceApply_update = true;--%>
<%--    </script>--%>
<%--</shiro:hasPermission>--%>
<script type="text/javascript">

    // //日期范围限制
    var start = {
        elem: '#beginTime',
        format: 'YYYY-MM-DD hh:mm:ss',
        // theme: '#3195f0',
        // min: laydate.now(), //设定最小日期为当前日期
        // max: '2099-06-16 23:59:59', //最大日期
        istime: true,
        istoday: false,
        choose: function (datas) {
            $("#endTime").val("")
            end.min = datas
        }
    };
    var end = {
        elem: '#endTime',
        format: 'YYYY-MM-DD hh:mm:ss',
        // theme: '#3195f0',
        // min: laydate.now(),
        // max: '2099-06-16 23:59:59',
        istime: true,
        istoday: false,
        choose: function (datas) {
            start.max = datas; //结束日选好后，重置开始日的最大日期
        }
    };
    laydate(start);
    laydate(end);
    laydate.skin('molv');//皮肤

    invoiceApply.init();
</script>
</body>
</html>
